package com.eliaukjq.xunlianying;

/**
 * @Author : 佩萁
 * Description :
 * @Create : 2024/7/11 - 19:45
 */
public class Drive {

    public void drive(int distance) {
        // 局部变量
        int miles = distance; // 必须初始化
        distance = 2;
        System.out.println(distance);
        int fuelNeeded = calculateFuel(miles); // 使用局部变量
        System.out.println("Fuel needed: " + fuelNeeded);
    }

    public int calculateFuel(int variable) {
        return 1;
    }

    public static void main(String[] args) {
        Drive drive = new Drive();
        drive.drive(12);

        int a = 1;
        int b = 2;
        float c = 1.1f;
    }
}